package com.dv.driverless.service.impl;

import java.util.List;
import com.dv.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dv.driverless.mapper.WarehouseAreaMapper;
import com.dv.driverless.domain.WarehouseArea;
import com.dv.driverless.service.IWarehouseAreaService;

/**
 * 库区信息Service业务层处理
 *
 * @author ruoyi
 * @date 2023-04-10
 */
@Service
public class WarehouseAreaServiceImpl implements IWarehouseAreaService
{
    @Autowired
    private WarehouseAreaMapper warehouseAreaMapper;

    /**
     * 查询库区信息
     *
     * @param id 库区信息主键
     * @return 库区信息
     */
    @Override
    public WarehouseArea selectWarehouseAreaById(Long id)
    {
        return warehouseAreaMapper.selectWarehouseAreaById(id);
    }

    /**
     * 查询库区信息列表
     *
     * @param warehouseArea 库区信息
     * @return 库区信息
     */
    @Override
    public List<WarehouseArea> selectWarehouseAreaList(WarehouseArea warehouseArea)
    {
        return warehouseAreaMapper.selectWarehouseAreaList(warehouseArea);
    }

    /**
     * 新增库区信息
     *
     * @param warehouseArea 库区信息
     * @return 结果
     */
    @Override
    public int insertWarehouseArea(WarehouseArea warehouseArea)
    {
        warehouseArea.setCreateTime(DateUtils.getNowDate());
        return warehouseAreaMapper.insertWarehouseArea(warehouseArea);
    }

    /**
     * 修改库区信息
     *
     * @param warehouseArea 库区信息
     * @return 结果
     */
    @Override
    public int updateWarehouseArea(WarehouseArea warehouseArea)
    {
        warehouseArea.setUpdateTime(DateUtils.getNowDate());
        return warehouseAreaMapper.updateWarehouseArea(warehouseArea);
    }

    /**
     * 批量删除库区信息
     *
     * @param ids 需要删除的库区信息主键
     * @return 结果
     */
    @Override
    public int deleteWarehouseAreaByIds(Long[] ids)
    {
        return warehouseAreaMapper.deleteWarehouseAreaByIds(ids);
    }

    /**
     * 删除库区信息信息
     *
     * @param id 库区信息主键
     * @return 结果
     */
    @Override
    public int deleteWarehouseAreaById(Long id)
    {
        return warehouseAreaMapper.deleteWarehouseAreaById(id);
    }
}
